home *** CD-ROM | disk | FTP | other *** search
/ Personal Computer World 2008 May / PersonalComputerWorld-May2008-CoverdiscCD.iso / Software / Full / Nero 7 / Installation / Cab / 83AF5E4E.cab / TextInput0C1B07A6.js < prev    next >
Encoding:
JavaScript  |  2006-06-20  |  1.7 KB  |  46 lines

  1. // Script in this file is for the text input ActiveX Control
  2.  
  3. function txtInputMouseOver(item)
  4. {
  5.     // This function is called from the behavior file TextInput.htc. It places focus on the text input control
  6.     // when it gets a mouseover event
  7.     
  8.     // if this is the first mouseover event that fires automatically when the page loads, return
  9.     // see comments in Hilite.js for an explanation of this
  10.     if (bFirstMouseover == true) return
  11.     
  12.     // make sure item is focusable
  13.     if (event.srcElement.MCFocusable != "true" || event.srcElement.MCTempUnFocusable == "true") return
  14.     // focus on item
  15.     oCurFocus = item
  16.     oCurFocus.focus()
  17. }
  18.  
  19.  
  20. function txtInputHilite(item)
  21. {
  22.     // This function highlights control to indicate it has focus; actually it is the control's
  23.     // parent HTML element that gets the highlight
  24.     
  25.     // make sure item is focusable
  26.     if (item.MCFocusable != "true") return
  27.     
  28.     // assign element its new class for highlighting
  29.     item.parentElement.className = item.parentElement.className + "_hilite"
  30.     // Call built-in function on the control to set focus
  31.     item.SetInputFocus() 
  32. }
  33.  
  34. function txtInputRestore(item)
  35. {
  36.     // this function restores non-highlight state to the control's parent HTML element
  37.     
  38.     // make sure item is focusable
  39.     if (item.MCFocusable != "true") return    
  40.     // identify class name of parent element
  41.     var c = item.parentElement.className        
  42.     // if class name does not end in "_hilite", exit function
  43.     if (c.substring((c.length -7), c.length) != "_hilite") return
  44.     // remove "_hilite" from class name to return to unhighlighted state
  45.     item.parentElement.className = c.substring(0,(c.length -7))
  46. }